package com.szakul.pdf.gui;

import org.apache.log4j.Logger;

import com.szakul.pdf.viewer.dao.beans.Leaf;
import com.vaadin.ui.AbsoluteLayout;
import com.vaadin.ui.Button;
import com.vaadin.ui.Label;
import com.vaadin.ui.RichTextArea;
import com.vaadin.ui.Button.ClickListener;

public class InfoLayout extends AbsoluteLayout{

    private static final Logger LOGGER = Logger.getLogger(InfoLayout.class);
	
	
    private Button editButton;
    private Label richText;
    private Label headerText;
    private Leaf leaf;

	public InfoLayout() {
		setWidth("100%");
		setHeight("100%");
		setImmediate(true);

		richText = new Label();
		headerText = new Label();
		headerText.setStyleName("h2");
		
		richText.setImmediate(true);
		headerText.setImmediate(true);
		richText.setContentMode(Label.CONTENT_XHTML);

        addComponent(richText,  "top:70px; left:30px");
        addComponent(headerText, "top:15px; left:30px");

        editButton = new Button("Edit");
        addComponent(editButton,  "bottom:30px; left:10px");

		
	}

	
	public void addEditButtonListener(ClickListener listener) {
		editButton.addListener(listener);
	}
	

	/**
	 * @return the richText
	 */
	public Label getRichText() {
		return richText;
	}


	/**
	 * @return the headerText
	 */
	public Label getHeaderText() {
		return headerText;
	}

	public Button getEditButton() {
		return editButton;
	}


	/**
	 * @return the leaf
	 */
	public Leaf getLeaf() {
		return leaf;
	}


	/**
	 * @param leaf the leaf to set
	 */
	public void setLeaf(Leaf leaf) {
		this.leaf = leaf;
	}
	
	
	
}
